import React, { Component } from 'react';
import TransferToChild1 from './Child1';
import TransferToChild2 from './Child2';
import TransferToChild3 from './Child3使用contextType';
// 1. 导入共享数据
import { glabalData, glabalContext, globalAction } from './common/js/globalData'
import './../../global.scss'
// 2. 合并state（状态） 数据
// 3. 解构glabalContext
const { Provider } = glabalContext
class TransferToChildParent extends Component {
    state = {
        ...glabalData,
        ...globalAction(this)
    }
    render() {
        return (<Provider value={this.state}>
            父组件读取role=：{this.state.role}
            <TransferToChild1 footer={<div>footer区域</div>}>匿名插槽==props.children</TransferToChild1>

            <TransferToChild2 />
            <TransferToChild3 />
        </Provider>);

    }
}

export default TransferToChildParent;